{% extends 'base.html' %}
{% block title %}资料发布中心{% endblock %}
{% block head %}
    <link href="{% static 'css/select2.min.css' %}" rel="stylesheet">
    <link href="{% static 'css/wangEditor/style.css' %}" rel="stylesheet">
    <style>
        #toolbar-container {
            border-bottom: 1px solid #ccc;
        }

        #editor-container {
            height: 500px;
        }
    </style>
{% endblock %}
{% block pageName %}内容发布{% endblock %}
{% block main %}
    <form method="post">
    {% csrf_token %}
        <div class="row">
            <div class="card">
                <div class="card-body">
                    <h4 class="card-title">基本信息</h4>
                    <p class="card-description">资源内容二次创作请加入数据来源<code>(资料来源链接)</code>保护他人知识产权和保护自己
                        <code>(禁止侵权)</code>
                    </p>
                    <div class="row g-3">
                        <div class="col-sm-7">
                            <input type="text" class="form-control" placeholder="标题" aria-label="标题" name="title">
                        </div>
                        <div class="col-sm">
                            <input type="text" class="form-control" placeholder="作者" aria-label="作者"
                                   name="author_name">
                        </div>
                        <div class="col-sm">
                            <input type="text" class="form-control" placeholder="数据来源" aria-label="数据源"
                                   name="data_source">
                        </div>
                    </div>
                </div>
            </div>
            <div class="card">
                <div class="card-body">
                    <h5 class="card-title">类别</h5>
                    <select class="js-states form-control select2-hidden-accessible" tabindex="-1"
                            style="display: none; width: 100%" data-select2-id="1" aria-hidden="true" name="category"
                            id="category-select">
                        <optgroup label="Eastern Time Zone">
                            {% for data in category %}
                                <option value="{{ data.id }}">{{ data.name }}</option>
                            {% endfor %}
                        </optgroup>
                    </select>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="card">
                <div class="card-body">
                    <div id="editor—wrapper">
                        <h5 class="card-title">内容</h5>
                        <div id="toolbar-container"><!-- 工具栏 --></div>
                        <div id="editor-container"><!-- 编辑器 --></div>
                    </div>

                </div>
                <div class="card-body text-end">
                    <a href="#" id="blockui-2" class="btn btn-primary">发布</a>
                </div>
            </div>
        </div>
    </form>
{% endblock %}
{% block footer %}

{% endblock %}
{% block js %}
    <script src="{% static 'js/select2.full.min.js' %}"></script>
    <script src="{% static 'js/select2.js' %}"></script>
    <script src="/static/js/jquery.blockUI.js"></script>
    <script src="{% static 'js/blockui.js' %}"></script>
    <script src="{% static 'js/wangEditor/index.js' %}"></script>
    <script src="{% static 'js/push_content.js' %}"></script>
{% endblock %}